<template>
	<private_tip :privateShow="privateb"></private_tip>
</template>

<script>
	var app = getApp();
	export default {
		data() {
			return {
				privateb:false,
			};
		}
		/**
		 * 页面初始化
		 */
		,
		onLoad: function(options) {
			let _this=this;
			if(app.globalData.wxprivate==-1){
				app.watchG('wxprivate',function(value){
					_this.wxprivate=value;
					if(value){ //弹出弹窗
						_this.privateb=true;
					}else{
						_this.onload(options);
					}
				})
			}else{
				if (app.globalData.wxprivate) { //弹出弹窗
					_this.privateb = true;
				} else {
					_this.onload(options);
				}
			}
		},
		onShareAppMessage(res) {
			let config = app.globalData.appConfig;
			return {
				title: config.share.title,
				desc: config.share.description,
				path: `/pages/index/index`,
				imageUrl: app.globalData.masterDomain + '/include/json.php?action=getSystemLogo'
			};
		},
		onShareTimeline() {
			return {
				title: config.share.title,
				imageUrl: app.globalData.masterDomain + '/include/json.php?action=getSystemLogo'
			};
		},
		methods: {
			onload(options){
				uni.redirectTo({
					url: 'plugin-private://wx2b03c6e691cd7370/pages/live-player-plugin?room_id=' + options.roomid
				});
			},
		}
	};
</script>
<style>
	@import './detail.css';
</style>